//package com.archive.manage.service.impl;
//
//import com.alibaba.fastjson2.JSON;
//import com.archive.framework.web.domain.server.Sys;
//import com.archive.manage.domain.StuArchive;
//import com.archive.manage.domain.StuClassInfo;
//import com.archive.manage.domain.entity.ArchiveGetResponse;
//import com.archive.manage.domain.entity.ArchiveGetResult;
//import com.archive.manage.service.IBlockchainService;
//
//import java.util.ArrayList;
//import java.util.Date;
//import java.util.List;
//
///** todo 测试利用的类，开发完成后删除
// *  @author Hamlin
// */
//public class Test {
//
//    private IBlockchainService blockchainService = new BlockchainServiceImpl();
//
//    public static void main(String[] args) throws Exception {
//        Test test = new Test();
////        test.exist();
////        test.create();
////        test.get();
//        test.update();
//    }
//
//    private void update() throws Exception {
//        StuArchive archive = get();
//        System.out.println("------archive info before update-----------------------------");
//        System.out.println(JSON.toJSON(archive));
//        archive.setName("李四");
//        String id = blockchainService.update("studentarchive", "channel3", "org1", "lisi", archive);
//        System.out.println("id: " + id);
//        archive = get();
//        System.out.println("------archive info after update------------------------------");
//        System.out.println(JSON.toJSON(archive));
//    }
//
//    private StuArchive get() throws Exception {
//        ArchiveGetResult result = blockchainService.getArchive("studentarchive", "channel3", "org1", "100001");
////        System.out.println(result.getId());
////        System.out.println(result.getData().getName());
//        return result.getData();
//    }
//
//    private void create() throws Exception {
//        StuArchive archive = new StuArchive();
//        archive.setStudentId("100001");
//        archive.setName("张三");
//        archive.setGender("男");
//        archive.setBirthDate(new Date());
//        archive.setIdCard("idCard100000001");
//        archive.setNation("汉");
//        archive.setPoliticalStatus("群众");
//        archive.setNativePlace("山东");
//        archive.setPhoto("photo path");
//        archive.setAdmissionDate(new Date());
//        archive.setGraduationDate(new Date());
//        archive.setStudentStatus("正常");
//        List<StuClassInfo> stuClassInfoList = new ArrayList<>();
//        StuClassInfo stuClassInfo = new StuClassInfo();
//        stuClassInfo.setStudentId("100001");
//        stuClassInfo.setGrade(2023l);
//        stuClassInfo.setMajorId(1111l);
//        stuClassInfo.setClasse("1班");
//        stuClassInfoList.add(stuClassInfo);
//        archive.setStuClassInfoList(stuClassInfoList);
//
//        String id = blockchainService.createArchive("studentarchive", "channel3", "org1", "zhangsan", archive);
//        System.out.println(id);
//    }
//
//    private void exist() throws Exception {
//        boolean result = blockchainService.existArchive("studentarchive", "channel3", "org1", "11");
//        System.out.println(result);
//    }
//}
